﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HelpModel : MonoBehaviour
{
    public GameObject CloseBtn;
    public GameObject HelpPanel;
    //RuleDDZ 按钮
    public GameObject ShowBtn1;
    public GameObject ConcealBtn1;
    //RuleFishing按钮
    public GameObject ShowBtn2;
    public GameObject ConcealBtn2;
    //RukeMahjong按钮
    public GameObject ShowBtn3;
    public GameObject ConcealBtn3;
    //RulePDK按钮
    public GameObject ShowBtn4;
    public GameObject ConcealBtn4;
    //RuleDN按钮
    public GameObject ShowBtn5;
    public GameObject ConcealBtn5;
    //RuleXTJ按钮
    public GameObject ShowBtn6;
    public GameObject ConcealBtn6;
    private void Awake()
    {
        UIEventListener.Get(CloseBtn).onClick = ButtonClick;
        UIEventListener.Get(ShowBtn1).onClick = ButtonClick;
        UIEventListener.Get(ConcealBtn1).onClick = ButtonClick;
        UIEventListener.Get(ShowBtn2).onClick = ButtonClick;
        UIEventListener.Get(ConcealBtn2).onClick = ButtonClick; 
        UIEventListener.Get(ShowBtn3).onClick = ButtonClick;
        UIEventListener.Get(ConcealBtn3).onClick = ButtonClick;
        UIEventListener.Get(ShowBtn4).onClick = ButtonClick;
        UIEventListener.Get(ConcealBtn4).onClick = ButtonClick;
        UIEventListener.Get(ShowBtn5).onClick = ButtonClick;
        UIEventListener.Get(ConcealBtn5).onClick = ButtonClick;
        UIEventListener.Get(ShowBtn6).onClick = ButtonClick;
        UIEventListener.Get(ConcealBtn6).onClick = ButtonClick;
    }

    void ButtonClick(GameObject button)
    {
        if (button.name == "CloseBtn")
        {
            Destroy(HelpPanel);
        }
        else if (button.name == "ConcealBtn1")
        {
            ShowBtn1.SetActive(true);
            ConcealBtn1.SetActive(false);
            ShowBtn2.SetActive(false);
            ConcealBtn2.SetActive(true);
            ShowBtn3.SetActive(false);
            ConcealBtn3.SetActive(true);
            ShowBtn4.SetActive(false);
            ConcealBtn4.SetActive(true);
            ShowBtn5.SetActive(false);
            ConcealBtn5.SetActive(true);
            ShowBtn6.SetActive(false);
            ConcealBtn6.SetActive(true);
        }
        else if (button.name == "ConcealBtn2")
        {
            ShowBtn2.SetActive(true);
            ConcealBtn2.SetActive(false);
            ShowBtn1.SetActive(false);
            ConcealBtn1.SetActive(true);
            ShowBtn3.SetActive(false);
            ConcealBtn3.SetActive(true);
            ShowBtn4.SetActive(false);
            ConcealBtn4.SetActive(true);
            ShowBtn5.SetActive(false);
            ConcealBtn5.SetActive(true);
            ShowBtn6.SetActive(false);
            ConcealBtn6.SetActive(true);
        }
        else if (button.name == "ConcealBtn3")
        {
            ShowBtn3.SetActive(true);
            ConcealBtn3.SetActive(false);
            ShowBtn2.SetActive(false);
            ConcealBtn2.SetActive(true);
            ShowBtn1.SetActive(false);
            ConcealBtn1.SetActive(true);
            ShowBtn4.SetActive(false);
            ConcealBtn4.SetActive(true);
            ShowBtn5.SetActive(false);
            ConcealBtn5.SetActive(true);
            ShowBtn6.SetActive(false);
            ConcealBtn6.SetActive(true);
        }
        else if (button.name == "ConcealBtn4")
        {
            ShowBtn4.SetActive(true);
            ConcealBtn4.SetActive(false);
            ShowBtn2.SetActive(false);
            ConcealBtn2.SetActive(true);
            ShowBtn3.SetActive(false);
            ConcealBtn3.SetActive(true);
            ShowBtn1.SetActive(false);
            ConcealBtn1.SetActive(true);
            ShowBtn5.SetActive(false);
            ConcealBtn5.SetActive(true);
            ShowBtn6.SetActive(false);
            ConcealBtn6.SetActive(true);
        }
        else if (button.name == "ConcealBtn5")
        {
            ShowBtn4.SetActive(false);
            ConcealBtn4.SetActive(true);
            ShowBtn2.SetActive(false);
            ConcealBtn2.SetActive(true);
            ShowBtn3.SetActive(false);
            ConcealBtn3.SetActive(true);
            ShowBtn1.SetActive(false);
            ConcealBtn1.SetActive(true);
            ShowBtn5.SetActive(true);
            ConcealBtn5.SetActive(false);
            ShowBtn6.SetActive(false);
            ConcealBtn6.SetActive(true);
        }
        else if (button.name == "ConcealBtn6")
        {
            ShowBtn4.SetActive(false);
            ConcealBtn4.SetActive(true);
            ShowBtn2.SetActive(false);
            ConcealBtn2.SetActive(true);
            ShowBtn3.SetActive(false);
            ConcealBtn3.SetActive(true);
            ShowBtn1.SetActive(false);
            ConcealBtn1.SetActive(true);
            ShowBtn5.SetActive(false);
            ConcealBtn5.SetActive(true);
            ShowBtn6.SetActive(true);
            ConcealBtn6.SetActive(false);
        }
       
    }
}
